{extend name='admin@public/content'}

{block name="button"}

<!--{if auth("$classuri/add")}-->
<!--<button data-open='{:url("$classuri/add")}' data-title="添加" class='layui-btn layui-btn-sm'>添加</button>-->
<!--{/if}-->

{if auth("$classuri/del")}
<!--<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-danger'>批量删除</button>-->
{/if}

<!--<button class='layui-btn layui-btn-sm layui-btn-warm' onclick="x_admin_show('活动二维码','https://api.51lyh.com/qr/qrcode.php?url=http://quan.sheyingtg.com/',280,350)">二维码</button>-->

{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">项目ID</label>
        <div class="layui-input-inline">
            <input name="id" value="{$Think.get.id}" placeholder="请输入项目ID" class="layui-input">
        </div>
    </div>-->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-inline">
            <input name="item" value="{$Think.get.item}" placeholder="请输入姓名" class="layui-input">
        </div>
    </div>


    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">手机号</label>
        <div class="layui-input-inline">
            <input name="phone" value="{$Think.get.phone}" placeholder="请输入手机号" class="layui-input">
        </div>
    </div>

    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="status" class="layui-select">
                <option value="">所有</option>
                &lt;!&ndash;{foreach ['-1'=>"审核不通过",'0'=>"待审核",'1'=>"已通过",'2'=>"已锁定"] as $k=>$v}&ndash;&gt;
                {if $Think.get.status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                &lt;!&ndash;{/foreach}&ndash;&gt;
            </select>
        </div>
    </div>-->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="status" class="layui-select">
                <option value="">所有</option>
                <!--{foreach ['0'=>"待核销",'1'=>"已核销"] as $k=>$v}-->
                {if $Think.get.status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                <!--{/foreach}-->
            </select>
        </div>
    </div>

    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">报名方式</label>
        <div class="layui-input-inline">
            <select name="reg_status" class="layui-select">
                <option value="">所有</option>
                &lt;!&ndash;{foreach ['0'=>"前台",'1'=>"后台"] as $k=>$v}&ndash;&gt;
                {if $Think.get.reg_status eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                &lt;!&ndash;{/foreach}&ndash;&gt;
            </select>
        </div>
    </div>-->

    <!--{if !empty($cates)}-->
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-inline">
            <select name="cate_id" id="cate_id" lay-search lay-filter="cate_id">
                <option value="">所有</option>
                {foreach $cates as $cate}
                <!--{if $Think.get.cate_id eq $cate.cate_id}-->
                <option selected="selected" value="{$cate.cate_id}">{$cate.name}</option>
                <!--{else}-->
                <option value="{$cate.cate_id}">{$cate.name}</option>
                <!--{/if}-->
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">学校</label>
        <div class="layui-input-inline">
            <input name="address" value="{$Think.get.address}" placeholder="请输入学校" class="layui-input">
        </div>
    </div>-->

    <script src="__STATIC__/plugs/layui/layui.all.js"></script>


    <script type="text/javascript">
        layui.use(['layer', 'form'],
            function() {
                var layer = layui.layer
                    ,form = layui.form;

                //监听省份选择
                form.on('select(province_id)',
                    function(data) {
                        $('#city_id').html('<option value="">所有</option>');
                        $.ajax({
                            url: "{:url('admin/info/get_city')}",
                            data: {
                                province_id: data.value
                            },
                            type: 'POST',
                            dataType: 'json',
                            success: function(data1) {
                                $("#city_id").append(data1);
                                form.render('select'); //刷新select选择框渲染
                            }
                        });
                    });


            });

    </script>

    <!--{if !empty($sources)}-->
    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">渠道分类</label>
        <div class="layui-input-inline">
            <select name="source" lay-search>
                <option value="">所有</option>
                {foreach $sources as $source}
                &lt;!&ndash;{if $Think.get.source eq $source.tag}&ndash;&gt;
                <option selected="selected" value="{$source.tag}">{$source.name}</option>
                &lt;!&ndash;{else}&ndash;&gt;
                <option value="{$source.tag}">{$source.name}</option>
                &lt;!&ndash;{/if}&ndash;&gt;
                {/foreach}
            </select>
        </div>
    </div>-->
    <!--{/if}-->


    <!--<div class="layui-form-item layui-inline">
        <label class="layui-form-label">是否饮用</label>
        <div class="layui-input-inline">
            <select name="is_use" class="layui-select">
                <option value="">所有</option>
                {foreach ['1'=>"经常饮用",'2'=>"有时饮用",'3'=>"较少饮用",'4'=>"未饮用"] as $k=>$v}
                {if $Think.get.is_use eq "$k"}
                <option selected="selected" value="{$k}">{$v}</option>
                {else}
                <option value="{$k}">{$v}</option>
                {/if}
                {/foreach}
            </select>
        </div>
    </div>-->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">创建时间</label>
        <div class="layui-input-inline">
            <input name="addtime" id="create_at" value="{$Think.get.addtime}" placeholder="请选择创建时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
    <!--{if auth("$classuri/outItems")}-->
    <div class="layui-form-item layui-inline">
        <button type="button" class="layui-btn layui-btn-primary" lay-submit="" lay-filter="outOrders"><i class="layui-icon">&#xe601;</i> 导 出Excel</button>
    </div>
    <!--{/if}-->
</form>
<script>
    window.laydate.render({range: true, elem: '#range-date'});

    //监听提交
    form.on('submit(outOrders)', function(data){
        params = data.field;
        layer.confirm('确认要导出吗？',function(){
            loading = layer.load(2, {
                shade: [0.2,'#000']
            })
            var url = "{:url('admin/info/outItems')}";
            DownLoad({ //调用下载方法
                url:url,data:params
            });
            layer.closeAll(); //关闭所有层

        });
    });

    /*通用下载导出*/
    function DownLoad(options) {
        var config = $.extend(true, { method: 'post' }, options);
        var $iframe = $('<iframe id="down-file-iframe" />');
        var $form = $('<form target="down-file-iframe" method="' + config.method + '" />');
        $form.attr('action', config.url);
        for (var key in config.data) {
            $form.append('<input type="hidden" name="' + key + '" value="' + config.data[key] + '" />');
        }
        $iframe.append($form);
        $(document.body).append($iframe);
        $form[0].submit();
        $iframe.remove();
    }
</script>
<!-- 表单搜索 结束 -->
<style>
    .asc{
        display: inline-block;
        font-size: 10px;
        cursor: pointer;
        padding-left: 10px;
    }
    .desc{
        display: inline-block;
        font-size: 10px;
        cursor: pointer;
        margin-left: 10px;
    }
</style>
<form onsubmit="return false;" data-auto="true" method="post">
    <!--{if empty($list)}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table notevent" lay-skin="line">
        <thead>
        <tr>
            <th class='list-table-check-td'>
                <input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'>
            </th>
            <!--<th class='list-table-sort-td'>-->
                <!--<button type="submit" class="layui-btn layui-btn-normal layui-btn-xs">排 序</button>-->
            <!--</th>-->
            <th class="nowrap">项目ID</th>
            <th class="nowrap">姓名</th>
<!--            <th class="nowrap">报名方式</th>-->
            <th class="nowrap">分类</th>
            <th class="nowrap">身份证</th>
            <th class="nowrap">电话</th>
            <th class="nowrap">地址</th>
            <th class="text-left">报名/核销时间</th>
            <th class="text-left">状态</th>
            <th class='text-center'></th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td text-top'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <!--<td class='list-table-sort-td text-top'>-->
                <!--<input name="_{$vo.id}" value="{$vo.sort}" class="list-sort-input">-->
            <!--</td>-->
            <td class='list-table-sort-td text-top'>
                {$vo.id}
            </td>
            <td class="text-left nowrap text-top">
                {:subtext($vo.item,6)}
            </td>
<!--            <td class="text-left nowrap text-top">-->
<!--                {if empty($vo.wechat_id)} 后台报名{else}前台{/if}-->
<!--            </td>-->
            <td class="text-left nowrap text-top">
                {$vo.cate_name}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.info}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.phone}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.address}
            </td>

            <td class='text-left nowrap text-top'>
                {:date('Y-m-d H:i:s',$vo.addtime)}<Br> {:date('Y-m-d H:i:s',$vo.updatetime)}
            </td>
            <td class='text-left nowrap text-top'>
               {if $vo.status} 已核销{else}待核销{/if}
            </td>

            <td class='text-center nowrap text-top'>

                <!--{if auth("$classuri/edit")}-->
<!--                <span class="text-explode">|</span>-->
<!--                <a data-open='{:url("$classuri/edit")}?id={$vo.id}'>编辑</a>-->
                <!--{/if}-->

<!--                <span class="text-explode">|</span>-->
<!--                <a data-title="查看详情" data-modal='{:url("$classuri/detail")}?id={$vo.id}'>详情</a>-->

                {if auth("$classuri/del")}
                <span class="text-explode">|</span>
                <a data-confirm="确认删除吗？" data-update="{$vo.id}" data-field='delete' data-action='{:url("$classuri/del")}'>删除</a>
                {/if}

                <!--{if $vo.status <> 0 and auth("$classuri/afresh")}-->
                <!--<span class="text-explode">|</span>-->
                <!--<a data-update="{$vo.id}" data-field='status' data-value='0' data-action='{:url("$classuri/afresh")}'>打回重审</a>-->
                <!--{/if}-->

                <!--{if $vo.status eq 0 and auth("$classuri/check")}-->
                <!--<span class="text-explode">|</span>-->
                <!--<a data-confirm="确认通过审核吗？" data-update="{$vo.id}" data-field='status' data-value='1' data-action='{:url("$classuri/check")}'><span style="color: red">审核通过</span></a>-->
                <!--{/if}-->

                <!--{if $vo.status eq 0 and auth("$classuri/operate")}-->
                <!--<span class="text-explode">|</span>-->
                <!--<a data-title="操作" data-modal='{:url("$classuri/operate")}?id={$vo.id}'><span style="color: red">审核不通过</span></a>-->
                <!--{/if}-->

                <!--{if $vo.status eq -1}-->
<!--                <span class="text-explode">| 审核不通过</span>-->
                <!--{/if}-->



            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/if}-->
</form>
<script>
    (function () {
        window.form.render();
        window.laydate.render({range: true, elem: '#create_at'});
    })();
</script>
<style>
    .headimg {
        width: 25px;
        height: 25px;
        border-radius: 50%;
        margin-right: 10px;
    }

</style>
{/block}